import { babel } from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
import gzipPlugin from 'rollup-plugin-gzip';

export default {
  input: './src/index.js',
  output: [
    {
      file: './dist/index.es.js',
      format: 'es'
    },
    {
      file: './dist/index.js',
      format: 'umd',
      name: 'ReactTinyStore'
    },
  ],
  external: ['react', 'react-dom'],
  plugins: [
    nodeResolve({
      extensions: ['.js', '.jsx']
    }),
    commonjs(),
    babel({
      exclude: '**/node_modules/**',
      babelHelpers: 'bundled'
    }),
    terser(),
    // gzipPlugin(),
  ]
}
